package com.landiao.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.landiao.entities.MdseStore;
import com.landiao.entities.Shop;
import com.landiao.mapper.MdseStoreMapper;
import com.landiao.mapper.ShopMapper;
@Service
public class MdseStoreService extends BaseService<MdseStore, String>{

	@Autowired
	private ShopMapper shopMapper;
	
	@Override
	protected MdseStoreMapper getBaseMapper() {
		// TODO Auto-generated method stub
		return (MdseStoreMapper)baseMapper;
	}
	
	/**
	 * 根据商品ID获取未添加库存的门店
	 * @param mdseId
	 * @param shopId
	 * @return
	 */
	public List<Shop> getNoStoreShop(String mdseId,String shopId){
		return this.shopMapper.selectNoStoreShopByMdseAndShop(shopId, mdseId);
	}
	
	public List<MdseStore> getMdseStoreByShopId(String mdseId,String shopId){
		MdseStore ms = new MdseStore();
		ms.setShopId(shopId);
		ms.setMdseId(mdseId);
		return this.getBaseMapper().queryByPage(ms, null);
	}
}
